﻿using System;
using System.Collections.Generic;
using NHibernate;
using SinBiota.Model.Entities;
using SinBiota.Model.Persistence.Repositories.Interfaces;

namespace SinBiota.Model.Persistence.Repositories.Implementation
{
    public class DepositaryUnitRepository : RepositoryAbstract<DepositaryUnit,int >, IDepositaryUnitRepository
    {
        public DepositaryUnitRepository(ISession session) : base(session)
        {
        }


        public DepositaryUnit FindByExactName(string name)
        {
            return FindByEqRestrictionUniqueResult(x => x.Name, name);
        }

        public IList<DepositaryUnit> FindByNameLike(string name)
        {
            return FindByInffix(x => x.Name, name);
        }
    }
}